using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Toenda.Rails.System;
using Toenda.Rails.DataContainer;

public partial class Controls_ctrl_footer : System.Web.UI.UserControl {
	private AccountProvider ap = new AccountProvider();

	/// <summary>
	/// Page_Load
	/// </summary>
	/// <param name="sender"></param>
	/// <param name="e"></param>
	protected void Page_Load(object sender, EventArgs e) {
		//if(Session.Count > 0 && ap.CheckSessionExist(Session["Zappr"].ToString())) {
		if(Session.Count > 0 && Session["ZapprUserId"] != null) {
			plcLogin.Visible = true;
			plcSignUp.Visible = false;

			//Account acc = ap.GetAccountBySession(Session["Zappr"].ToString());
			Account acc = ap.GetAccount(Session["ZapprUserId"].ToString());

			linkMyImages.NavigateUrl = "~/default.aspx?id=images&user=" + acc.Username;
			linkMyProfile.NavigateUrl = "~/default.aspx?user=" + acc.Username;
		}
		else {
			plcLogin.Visible = false;
			plcSignUp.Visible = true;
		}
	}
}
